﻿<SettingsFlyout
    x:Class="RssReader.Common.Settings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="Manage Categories"
    HeaderForeground="White" 
    HeaderBackground="#00b2f0"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    
<Grid x:Name="MainGrid"
        DataContext="{Binding Group}">

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <ProgressRing Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="ring" Height="60" Width="60"/>
            <ScrollViewer
                        x:Name="snappedScrollViewer"
                        AutomationProperties.AutomationId="SnappedDetailsScrollViewer"
                        Grid.Row="1"
                        Style="{StaticResource VerticalScrollViewerStyle}">
                            <StackPanel>
                                <ItemsControl MinHeight="500"
                                AutomationProperties.AutomationId="ItemListView"
                                AutomationProperties.Name="Categories"
                                Margin="10,0,0,60"
                                    x:Name="ItemListView">
                                    <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid HorizontalAlignment="Left" Width="250">
                                            <StackPanel VerticalAlignment="Bottom" Background="Transparent">
                                                <TextBlock Text="{Binding Name}" Foreground="Black"  
                                   Style="{StaticResource TitleTextStyle}" Margin="0,0,15,0" TextWrapping="Wrap" VerticalAlignment="Top" />
                                            <StackPanel VerticalAlignment="Bottom" Background="Transparent" Orientation="Horizontal">

                                            
                                                <ToggleSwitch OnContent="Show" OffContent="Hide" Foreground="Black" IsOn="{Binding Visible}" Tag="{Binding Name}" Toggled="Toggled" />
                                                <Button Content="&#xE21E;" Background="White" Foreground="Black" FontSize="46" FontFamily="Segoe UI Symbol" BorderThickness="0" Click="Delete_category" Tag="{Binding Name}"/>
                                            </StackPanel>
                                            </StackPanel>
                                        </Grid>
                                    </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                        </StackPanel>
             </ScrollViewer>
            
            <TextBlock Text="Please restart the app after changing any settings" Style="{StaticResource PageSubheaderTextStyle}"/>

        
        </Grid>
    </Grid>
</SettingsFlyout>
